﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace MDCAdminTool
{
    public enum RegionReplicaState
    {
        Idle=3 ,
        Primary=0 ,
        Secondary=1
    }


    public class CacheRegionStats : INotifyPropertyChanged
    {
        // Fields
        private long _itemCount;
        private long _missCount;
        private string _regionName;
        private RegionReplicaState _replicaRole;
        private long _requestCount;
        private long _size;

        // Properties
        public long ItemCount
        {
            get
            {
                return this._itemCount;
            }
            set
            {
                this._itemCount = value;
                OnPropertyChanged( "ItemCount" );
            }
        }
        public long MissCount
        {
            get
            {
                return this._missCount;
            }
            set
            {
                this._missCount = value;
                OnPropertyChanged( "MissCount" );
            }
        }
        public string RegionName
        {
            get
            {
                return this._regionName;
            }
            set
            {
                this._regionName = value;
                OnPropertyChanged( "RegionName" );
            }
        }
        public long RequestCount
        {
            get
            {
                return this._requestCount;
            }
            set
            {
                this._requestCount = value;
                OnPropertyChanged( "RequestCount" );
            }
        }
        public RegionReplicaState Role
        {
            get
            {
                return this._replicaRole;
            }
            set
            {
                this._replicaRole = value;
                OnPropertyChanged( "Role" );
            }
        }
        public long Size
        {
            get
            {
                return this._size;
            }
            set
            {
                this._size = value;
                OnPropertyChanged( "Size" );
            }
        }


        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler  PropertyChanged;
        void OnPropertyChanged( string prop )
        {
            if( PropertyChanged != null )
                PropertyChanged( this , new PropertyChangedEventArgs(prop) );
        }

        #endregion
    }
}
